#coding=utf-8
from url import url
from bottle import static_file, request
import os


IMAGE_PATH = './web/static'

class Upload:
	@url.get('/:filename#.+#.:typle')
	def index(filename,typle):
		size = request.query_string
		filename = filename + '.' + typle
		if size:
			filename = filename + '#' + size
			path = os.path.join(IMAGE_PATH, filename)
			if not os.path.exists(path):
				print tuple(size.split(','))
		return static_file(filename, root=IMAGE_PATH)